package com.xckj.cycling.framework.net;

import androidx.annotation.NonNull;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Protocol;
import okhttp3.Response;

/**
 * @Author: ChenYao
 * @Describe: 网络拦截器
 * @Date: 2023/2/26 19:09
 */
public class NetIntercept implements Interceptor {
    @NonNull
    @Override
    public Response intercept(@NonNull Chain chain) throws IOException {
        return new Response.Builder()
                .code(404)
                .message("当前无网络")
                .body(new EmptyResponseBody())
                .protocol(Protocol.HTTP_1_1).request(chain.request()).build();
    }
}
